from gq.med_qa.data_processing import clean_text, cut_word, remove_stop_words
from gq.med_qa.med_predict import SVM, LR, KNN, Multi, DecisionTree
from sklearn.feature_extraction.text import TfidfVectorizer


def text_to_idf(text):
    text = clean_text(text)
    text = cut_word(text)
    text = remove_stop_words(text)
    text_tfidf = TfidfVectorizer(binary=False, token_pattern=r"(?u)\b\w+\b")
    input_text = text_tfidf.fit_transform(text)
    return input_text


def predict():
    # text = text_to_idf(text)
    svm = SVM()
    lr = LR()
    knn = KNN()
    multi = Multi()
    dtree = DecisionTree()
    result = []
    dict_svm = {"SVM": svm}
    result.append(dict_svm)
    dict_lr = {"LR": lr}
    result.append(dict_lr)
    dict_knn = {"KNN": knn}
    result.append(dict_knn)
    dict_multi = {"MultinomialNB": multi}
    result.append(dict_multi)
    dict_dtree = {"DecisionTree": dtree}
    result.append(dict_dtree)
    return result


if __name__ == '__main__':
    # text = "this is an example"
    print(predict())
